<script setup>
const props = defineProps({
  dataList: {
    type: Array,
    default: () => [],
  },
})

const toDetail = (item) => {
  uni.navigateTo({
  	url:'/pages/active-detail/active-detail?id='+item?.id
  })
}
</script>

<template>
  <view class="block-list">
    <view class="item" v-for="(item, index) in dataList" :key="index">
      <image :src="item.streetCover" mode="aspectFill" />
      <view class="right">
        <view class="title limit2">{{ item.streetName }}</view>
        <view class="desc limit3">
          {{ item.streetDescrip }}
        </view>
        <view class="address"> {{ item.streetLocation }} </view>
        <view @click="()=>toDetail(item)" class="jump-desc">了解详情 ></view>
      </view>
    </view>
  </view>
</template>

<style lang="scss" scoped>
.flex-center {
  display: flex;
  justify-content: center;
}
.limit2 {
  overflow: hidden;
  word-break: break-all;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.limit3 {
  overflow: hidden;
  word-break: break-all;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.block-list {
  display: flex;
  overflow-x: scroll;
  padding: 0 40rpx;
  margin-top: 44rpx;
  .item {
    margin-right: 40rpx;
    display: flex;
    width: 100%;
    height: 524rpx;
    padding: 40rpx;
    background: #ffffff;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.05);
    image {
      width: 328rpx;
      height: 100%;
      flex-shrink: 0;
      border-radius: 20rpx;
    }
    .right {
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      width: 260rpx;
      margin-left: 40rpx;
      .title {
        font-size: 34rpx;
        font-weight: 500;
        color: #000000;
      }
      .desc {
        font-size: 28rpx;
        font-weight: 400;
        color: #333333;
        margin: 46rpx 0 26rpx;
      }
      .address {
        font-size: 28rpx;
        font-weight: 400;
        color: #999999;
      }
      .jump-desc {
        text-align: right;
        font-size: 28rpx;
        font-weight: 400;
        color: #ea5404;
        margin-top: 40rpx;
      }
    }
  }
  .item:last-child {
    margin-right: 0;
  }
}
</style>
